/*
 *****************************************************************************
 * Copyright (C) 2005-2011 UC Mobile Limited. All Rights Reserved
 * File			: AutomatedMenuDataProcessor.m
 *
 * Description	: 常用自动化测试菜单事件驱动者
 *
 * Author		: daijb@ucweb.com
 * History		:
 *			   Creation, 2014/03/14, daijb, Create the file
 ******************************************************************************
 **/
#if defined(UC_COMMON_AUTOMATED_TEST) || defined(UC_MONKEY_TEST)
#import "VerDefine.h"

#import "AutomatedMenuDataProcessor.h"

@implementation AutomatedMenuDataProcessor

//日夜间切换
- (void)onClickDayAndNightSwitchSetting:(NSString*)itemName
{
    [g_automatedFuncInstance dayAndNightSwitch];
    [self dismissWithAnimation:YES completion:nil];
}

//进入全屏/退出全屏
- (void)onClickFullScreenSwitchSetting:(NSString*)itemName
{
    [self dismissWithAnimation:YES completion:^{
        [g_automatedFuncInstance fullScreenSwitch];
    }];
}

//无图模式开关
- (void)onClickNoPictureModeSetting:(NSString*)itemName
{
    [g_automatedFuncInstance noPictureMode];
    [self dismissWithAnimation:YES completion:nil];
}

- (void)onClickSpeedModeSetting:(NSString*)itemName
{
    [g_automatedFuncInstance speedModeSwitch];
    [self dismissWithAnimation:YES completion:nil];
}

//退出浏览器
- (void)onClickExitBrowserSetting:(NSString*)itemName
{
    [g_automatedFuncInstance exitBrowser];
    [self dismissWithAnimation:YES completion:nil];
}

- (void)dismissWithAnimation:(BOOL)animation completion:(void(^)(void))completion
{
    if (self.delegate && [self.delegate respondsToSelector:@selector(dismissWithAnimatin:completion:)])
    {
        [self.delegate dismissWithAnimatin:YES completion:completion];
    }
}

@end
#endif
